package com.aya.ite.component;

import java.util.Iterator;

public class Dinner extends AbstractMenu implements MenuComponent {
    private Menu[] menuItems  = new Menu[6];
    private int position = 0;

    public boolean addMenu(Menu menuItem) {
        if(position< menuItems.length){
            menuItems[position] = menuItem;
            position++;
        }
        return false;
    }

    @Override
    public Iterator<Menu> createIterator() {
        return new IteratorAdaptor(menuItems);
    }
    @Override
    public String getName() {
        return "午餐店";
    }
}
